package com.dglg.spring.service.impl;

import com.dglg.spring.dao.TrainingClassDao;
import com.dglg.spring.model.TeachComment;
import com.dglg.spring.service.CommentService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CommentServiceImpl implements CommentService {

    @Autowired
    private TrainingClassDao trainingClassDao;

    @Override
    public int addComment(String studentId, String className, String content, String device) {
        TeachComment teachComment = new TeachComment();
        teachComment.setclassName(className);
        teachComment.setStudentId(studentId);
        teachComment.setContent(content);
        teachComment.setDevice(device);

        return trainingClassDao.insert(teachComment);
    }
}
